package com.javalong.affairs.module.main.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.javalong.affairs.R;
import com.javalong.affairs.base.fragment.BaseFragment;
import com.javalong.affairs.base.manager.IntentManager;
import com.javalong.affairs.module.main.activity.NewMainActivity;
import com.javalong.affairs.module.renwujinzhang.activity.NewTaskActivity;
import com.javalong.affairs.module.renwujinzhang.activity.SuperviseActivity;
import com.javalong.affairs.module.renwujinzhang.activity.complete.CompleteListActivity;
import com.javalong.affairs.module.renwujinzhang.activity.praise.PraiseListActivity;
import com.javalong.affairs.module.renwujinzhang.activity.receive.ReceiveListActivity;
import com.javalong.affairs.module.renwujinzhang.activity.supervise.SuperviseListActivity;

/**
 * Created by javalong on 2016/5/15.
 */
public class WorkFragment extends BaseFragment implements View.OnClickListener {

    private ImageView iv_work_1;
    private ImageView iv_work_2;
    private ImageView iv_work_3;
    private ImageView iv_work_4;
    private ImageView iv_work_5;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = LayoutInflater.from(container.getContext()).inflate(R.layout.fragment_work, container, false);
        initUI(view);
        initData();
        return view;
    }

    private void initData() {

    }


    private void initUI(View view) {
        iv_work_1 = (ImageView) view.findViewById(R.id.iv_work_1);
        iv_work_2 = (ImageView) view.findViewById(R.id.iv_work_2);
        iv_work_3 = (ImageView) view.findViewById(R.id.iv_work_3);
        iv_work_4 = (ImageView) view.findViewById(R.id.iv_work_4);
        iv_work_5 = (ImageView) view.findViewById(R.id.iv_work_5);
        iv_work_1.setOnClickListener(this);
        iv_work_2.setOnClickListener(this);
        iv_work_3.setOnClickListener(this);
        iv_work_4.setOnClickListener(this);
        iv_work_5.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.iv_work_1:
                IntentManager.doActivity(getActivity(),
                        NewTaskActivity.class);
                break;
            case R.id.iv_work_2:
                IntentManager.doActivity(getActivity(),
                        ReceiveListActivity.class);
                break;
            case R.id.iv_work_3:
                IntentManager.doActivity(getActivity(),
                        SuperviseListActivity.class);
                break;
            case R.id.iv_work_4:
                IntentManager.doActivity(getActivity(),
                        CompleteListActivity.class);
                break;
            case R.id.iv_work_5:
                IntentManager.doActivity(getActivity(),
                        PraiseListActivity.class);
                break;

        }
    }
}
